#include<iostream>
#include"contacts.pb.h"
int main()
{
    contacts::contact as;
    as.set_age(18);
    as.set_name("小明");
    std::string str=as.SerializePartialAsString();
    contacts::contact aq;
    bool q=aq.ParseFromString(str); 
    if(!q)
    {
        std::cerr<<"ParseFromString";
    }
    std::cout<<aq.age()<<std::endl;
    std::cout<<aq.name()<<std::endl;
    return 0;

}